Component({
  /**
   * 组件的属性列表
   */
  properties: {
    title:String,
    value:Object,
    quesultList:Array
  },

  /**
   * 组件的初始数据
   */
  data: {
    valueInfo:[0,0,0,0,0,0,0],
    topIndex:-1
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //取消按钮
    cancel(){
      //发射出去事件
      this.triggerEvent('closeselectModel',{show:false})
    },
    //监听修改的内容
    watchInfo(e){
      let num = e.currentTarget.dataset.id
      if(this.data.topIndex!=num){
        this.setData({
          topIndex:num
        })
      }else{
        this.setData({
          topIndex:-1
        })
      }
    },
    //getQues获取问题描述
    getQues(e){
      //console.log(this.properties.value)
      let index = this.data.topIndex
      let str ="value[" + index + "]"
      let str1 = 'valueInfo['+index+']'
      //console.log(str)
      this.setData({
        [str]:e.currentTarget.dataset.info,
        [str1]:e.currentTarget.dataset.id,
        topIndex:-1
      })
    },
    //修改按钮
    confirm(){
      this.triggerEvent('changeselectModel',{show:false,value:this.data.valueInfo,text:this.properties.value})
    }
  }
})
